﻿@page "/dragdrops"
@inject IStringLocalizer<DragDrops> Localizer

<h3>@Localizer["Title"]</h3>

<h4>@Localizer["H1"]</h4>

<DemoBlock Title="@Localizer["P1"]" Introduction="@Localizer["P2"]" Name="Normal">
    <Row ItemsPerRow="ItemsPerRow.Two">
        <Dropzone TItem="string" Items="@StrList1">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
        <Dropzone TItem="string" Items="@StrList2">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
    </Row>
</DemoBlock>

<DemoBlock Title="@Localizer["P3"]" Introduction="@Localizer["P4"]" Name="Normal">
    <Row ItemsPerRow="ItemsPerRow.Two">
        <Dropzone TItem="string" Items="@StrList1">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
        <Dropzone TItem="string" Items="@StrList2" CopyItem="s => new string(s)">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
    </Row>
</DemoBlock>

<DemoBlock Title="@Localizer["P5"]" Introduction="@Localizer["P6"]" Name="Normal">
    <Row ItemsPerRow="ItemsPerRow.Two">
        <Dropzone TItem="string" Items="@StrList1" Accepts="@((s, s1) => s == "10")" AllowsDrag="@(s => s != "2")">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
        <Dropzone TItem="string" Items="@StrList2" MaxItems="6">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
    </Row>
</DemoBlock>

<DemoBlock Title="@Localizer["P7"]" Introduction="@Localizer["P8"]" Name="Normal">
    <Row ItemsPerRow="ItemsPerRow.Two">
        <Dropzone TItem="string" Items="@StrList1" Accepts="@((s, s1) => s == "10")" OnItemDropRejected="@OnItemDropRejected" OnItemDrop="@OnItemDrop" OnReplacedItemDrop="@OnReplacedItemDrop">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
        <Dropzone TItem="string" Items="@StrList2" MaxItems="6" OnItemDropRejectedByMaxItemLimit="@OnItemDropRejectedByMaxItemLimit" OnItemDrop="@OnItemDrop" OnReplacedItemDrop="@OnReplacedItemDrop">
            <Card IsShadow="true">
                <CardBody>
                    @context
                </CardBody>
            </Card>
        </Dropzone>
    </Row>
    <BlockLogger @ref="Trace" class="mt-3" />
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />

<MethodTable Items="GetMethods()"></MethodTable>
